@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-12 ">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <a href="{{route('admin.order')}}">待出票订单</a> &nbsp;<span class="badge">{{$cnt}}</span>
                </div>
                <div class="panel-body">
                    <table class="table">
                    <thead>
                        <tr>
                            <th>订单日期</th>
                            <th>订单编号</th>
                            <th>行程</th>
                            <th>用车方</th>
                            <th>联系电话</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach($list as $item)                    
                        <tr>
                            <td>{{$item->created_at}}</td>
                            <td>{{$item->code}}</td>
                            <td>{{$item->start}}&nbsp;-&nbsp;{{$item->end}}</td>
                            <td>{{$item->name}}</td>
                            <td>{{$item->phone}}</td>
                            <td>{{$item->status_text}}</td>
                            <td>
                                <a href="{{route('admin.order.detail',['id'=>$item->id])}}">
                                        订单详情
                                </a>&nbsp;
                                @if($item->status==0)
                                <a href="{{route('admin.order.detail',['id'=>$item->id])}}">
                                    出票
                                </a>
                                @endif
                            </td>
                        </tr>
                        @endforeach
                    </tbody>
                    </table>
                    
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
